#include<stdio.h>

int main()
{
	int y = 1, x, n, all = 0;
	scanf_s("%d", &n);
	for (x = 1; x <= n; x++)
	{
		y = y * x;
		all = all + y;
	}
	printf("%d\n", all);
	return 0;
}
